/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gpaltan.db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author srkrishnan
 */
public class DBUtil
{

    public static ResultSet execute(Connection conn, String query)
    {

        // create the java statement
        Statement st = null;
        ResultSet rs =null;
        try
        {
            st = conn.createStatement();
        } catch (SQLException ex)
        {
            Logger.getLogger(DBUtil.class.getName()).log(Level.SEVERE, null, ex);
        }
        try
        {
            // execute the query, and get a java resultset
            rs = st.executeQuery(query);
        } catch (SQLException ex)
        {
            Logger.getLogger(DBUtil.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs;
    }
}
